package com.yiyuan.system.service;

import java.util.List;

import com.yiyuan.common.exception.SubRecExistException;
import com.yiyuan.system.model.Employee;
import com.yiyuan.system.model.Group;
import com.yiyuan.system.model.GroupUser;
import com.yiyuan.system.model.Organ;
import com.yiyuan.system.model.PriResource;
import com.yiyuan.system.model.Role;
import com.yiyuan.system.model.RolePri;
import com.yiyuan.system.model.User;
import com.yiyuan.system.model.UserPri;
import com.yiyuan.system.model.UserRole;
import com.yiyuan.system.object.UserObject;

public interface ISystemService {
	/** *******************1、组织机构管理************************** */
	public List<Organ> findOrgList();

	public int getPageCount();

	public Organ loadOrgan(Integer orgId);

	public void addOrgan(Organ organ);

	public void updateOrgan(Organ organ);

	public void deleteOrgan(Integer orgId) throws SubRecExistException;

	public List<Organ> findSubOrgList(String orgId);

	/** ******************2、用户管理****************************** */
	public List<User> findUserList(int startIndex, int endIndex,Integer deptId,Integer empId);

	public int getUserPageCount(Integer deptId,Integer empId);

	public void addUser(User user);

	public void updateUser(User user);
		
	public void deleteUser(Integer userId);
	
	public User getUser(Integer userId);
	
	public List<UserRole> findUserRoleListByUserId(Integer userId);
	
	public List<UserPri> findUserPriListByUserId(Integer userId);
	
	public User getUserByNameAndPwd(String userName,String password);
	
	public List<UserObject> getUserList(String deptId);

	/** *******************3、权限资源管理************************* */

	public PriResource loadPriResource(Integer resId);

	public void addPriResource(PriResource priResource);

	public void updatePriResource(PriResource priResource);

	public void deletePriResource(Integer resId) throws SubRecExistException;

	public List<PriResource> findSubPriResList(String resId);
	
	public List<PriResource> findPriResList();

	/** ******************4、角色管理****************************** */
	public List<Role> findRoleList(int startIndex, int endIndex,String roleName);

	public int getRolePageCount(String roleName);

	public void addRole(Role role);

	public void updateRole(Role role);
	
	public void deleteRole(Integer roleId);
	
	public Role loadRole(Integer roleId);
	
	public List<Role> findRoleList();
	
	public List<RolePri> findRolePriListByRoleId(Integer roleId);
	
	/** ******************5、人员管理****************************** */
	public List<Employee> findEmpList(int startIndex, int endIndex,String empName,Integer deptId);

	public int getEmpPageCount(String empName,Integer deptId);

	public void addEmp(Employee employee);

	public void updateEmp(Employee employee);
	
	public void deleteEmp(Integer empId);
	
	public Employee loadEmp(Integer empId);
	
	public List<Employee> getEmpListByDeptId(Integer deptId);
	
	/** ******************6、组管理****************************** */
	public List<Group> findGroupList(int startIndex, int endIndex,String groupName);

	public int getGroupPageCount(String groupName);

	public void addGroup(Group group);

	public void updateGroup(Group group);
	
	public void deleteGroup(Integer groupId);
	
	public Group loadGroup(Integer groupId);
	
	public List<Group> findGroupList(Integer userId);
	
	public List<GroupUser> findGroupUserListByGroupId(Integer groupId);
	
	public List<GroupUser> findDDList(Integer groupId);
}
